package com.ciwong.epaper.modules.epaper.util;

import android.app.Activity;
import android.content.Intent;
import android.support.v4.app.Fragment;

import com.ciwong.ciwongwrite.JournalActivity;
import com.ciwong.epaper.R;
import com.ciwong.epaper.modules.bookstore.bean.BannerBean;
import com.ciwong.epaper.modules.bookstore.bean.PubLishClassBean;
import com.ciwong.epaper.modules.bookstore.bean.PublishWorkContent;
import com.ciwong.epaper.modules.bookstore.bean.StudentGroupBean;
import com.ciwong.epaper.modules.bookstore.ui.BannerAdActivity;
import com.ciwong.epaper.modules.clazz.ui.WorkReportActivity;
import com.ciwong.epaper.modules.cordva.html.TestActicity;
import com.ciwong.epaper.modules.epaper.bean.CatalogueInfo;
import com.ciwong.epaper.modules.epaper.bean.EpaperInfo;
import com.ciwong.epaper.modules.epaper.bean.FollowreadTextParagraphBean;
import com.ciwong.epaper.modules.epaper.bean.ListenSpeakExaminBean;
import com.ciwong.epaper.modules.epaper.bean.Subject;
import com.ciwong.epaper.modules.epaper.ui.AddBookActivity;
import com.ciwong.epaper.modules.epaper.ui.AllServiceOrBookActivity;
import com.ciwong.epaper.modules.epaper.ui.AttentionWorkActivity;
import com.ciwong.epaper.modules.epaper.ui.ChooseGroupActivity;
import com.ciwong.epaper.modules.epaper.ui.ChooseSentenceActivity;
import com.ciwong.epaper.modules.epaper.ui.ChooseWordActivity;
import com.ciwong.epaper.modules.epaper.ui.EditBookActivity;
import com.ciwong.epaper.modules.epaper.ui.InteractiveTutorialDetaisActivity;
import com.ciwong.epaper.modules.epaper.ui.ListenSpeakChooseWorkActivity;
import com.ciwong.epaper.modules.epaper.ui.ListenSpeakChooseWorkHtml;
import com.ciwong.epaper.modules.epaper.ui.ListenSpeakTopicDetaisActivity;
import com.ciwong.epaper.modules.epaper.ui.PublishDKWorkHtml;
import com.ciwong.epaper.modules.epaper.ui.SearchBookActivity;
import com.ciwong.epaper.modules.epaper.ui.SelectQuestionActivity;
import com.ciwong.epaper.modules.epaper.ui.ShopSearchBookActivity;
import com.ciwong.epaper.modules.epaper.ui.TeaCatalogActivity;
import com.ciwong.epaper.modules.epaper.ui.TeaPublishSuccessActivity;
import com.ciwong.epaper.modules.epaper.ui.TeaPublishWorkActivity;
import com.ciwong.epaper.modules.epaper.ui.TeaWorkContentActivity;
import com.ciwong.epaper.modules.homework.bean.ClassWorkContent;
import com.ciwong.epaper.modules.homework.bean.ClassWorkRecord;
import com.ciwong.epaper.modules.homework.bean.PublishWorkRecords;
import com.ciwong.epaper.modules.me.bean.FavoritesBook;
import com.ciwong.epaper.modules.me.bean.FollowReadWordDetailBeans;
import com.ciwong.epaper.modules.me.bean.FollowTeacher;
import com.ciwong.epaper.modules.me.bean.HomeWorkContents;
import com.ciwong.epaper.modules.me.bean.Service;
import com.ciwong.epaper.modules.me.ui.ClassGradesActivity;
import com.ciwong.epaper.modules.me.ui.ClassWorkGradesActivity;
import com.ciwong.epaper.modules.me.ui.DKWorkDetailsActivity;
import com.ciwong.epaper.modules.me.ui.StudentGradesActivity;
import com.ciwong.epaper.ui.MainActivity;
import com.ciwong.epaper.util.IntentFlag;
import com.ciwong.mobilelib.utils.BaseActivityManager;
import com.ciwong.mobilelib.utils.BaseIntentFlag;
import com.ciwong.mobilelib.utils.BaseJumpManager;
import com.ciwong.mobilelib.utils.XXPermissionTool;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 电子报 跳转管理类
 *
 * @author bin
 * @version ciwong v.1.0 2015/7/23 19:36
 * @since ciwong v.1.0
 */
public class EpaperJumpManager extends BaseJumpManager {


    private static boolean isContainsActivityInStack(Class clazz) {
        if (clazz != null) {
            return BaseActivityManager.getInstance().isContainsActivityInStack(clazz);
        }
        return false;
    }

    /**
     * 跳转到选择题目界面
     *
     * @param goBackId
     * @param act
     * @param isDoRecords 是否做的记录
     * @param requestCode
     */
    public static void jumpToSelectQuestion(int goBackId, Activity act,
                                            ArrayList<Boolean> isDoRecords, int requestCode) {
        Intent intent = getBaseIntent(goBackId, act,
                SelectQuestionActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_OBJ_LIST, isDoRecords);
        act.startActivityForResult(intent, requestCode);
    }

    /**
     * 跳转到书籍目录页面
     *
     * @param goBackId
     * @param context
     * @param info
     * @param from        来源IntentValue.JumpToBookCatalogType
     * @param requestCode
     */
    public static void jumpToCatalog2(int goBackId, Activity context, String tag,
                                      FavoritesBook info, int from, int requestCode, int serviceId) {
        Intent intent = getBaseIntent(goBackId, context, TeaCatalogActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_TAG, tag);
        intent.putExtra(BaseIntentFlag.INTENT_FLAG_OBJ, info);
        intent.putExtra(BaseIntentFlag.INTENT_FLAG_ACTION, from);
        intent.putExtra(IntentFlag.INTENT_FLAG_SERVICE_ID, serviceId);
        context.startActivityForResult(intent, requestCode);
    }

    /**
     * 跳转到书籍内容页面
     *
     * @param goBackId 返回按钮的文字id
     * @param act      启动activity
     */
    public static void jumpToTeaWorkContent(int goBackId, Activity act, String tag, CatalogueInfo catalogueInfo, int serviceId, FavoritesBook epaperInfo,
                                            List<EpaperInfo.Server> serverList, int workTag, List<PublishWorkContent> publishWorkContents, int requestCode) {
        Intent intent = getBaseIntent(goBackId, act, TeaWorkContentActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_CATALOGUE_INFO, catalogueInfo);
        intent.putExtra(IntentFlag.INTENT_FLAG_TAG, tag);
        intent.putExtra(IntentFlag.INTENT_FLAG_SERVICE_ID, serviceId);
        intent.putExtra(BaseIntentFlag.INTENT_FLAG_OBJ, epaperInfo);
        intent.putExtra(IntentFlag.INTENT_FLAG_OBJ_LIST, (Serializable) serverList);
        intent.putExtra(IntentFlag.INTENT_FLAG_WORK_TAG, workTag);
        intent.putExtra(IntentFlag.INTENT_FLAG_REQUEST_CODE_FROM, requestCode);
        intent.putExtra(IntentFlag.INTENT_FLAG_OBJ_LIST, (Serializable) publishWorkContents);
        act.startActivityForResult(intent, requestCode);
    }

    /**
     * 跳转到书发布作业页面
     *
     * @param act 启动activity
     */
    public static void jumpToTeaPublishWork(int goBackId, Activity act, String tag, String bookName, int workType, List<PublishWorkContent> publishWorkContent, int subjectId) {

        Intent intent = getBaseIntent(goBackId, act, TeaPublishWorkActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_TAG, tag);
        intent.putExtra(IntentFlag.INTENT_FLAG_BOOK_NAME, bookName);
        intent.putExtra(IntentFlag.INTENT_FLAG_WORK_TYPE, workType);
        //intent.putExtra(IntentFlag.INTENT_FLAG_WORK_NAME_LIST, (Serializable) workNames);
        intent.putExtra(IntentFlag.INTENT_FLAG_OBJ_LIST, (Serializable) publishWorkContent);
        intent.putExtra(IntentFlag.INTENT_FLAG_SUBJECTID, subjectId);
        act.startActivity(intent);
    }

    /**
     * 跳转到作业列表
     */
    public static void jumpToWorkList(Activity act, String tag, int requestCode) {
        //.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK) :将老的activity清除掉
        Intent intent = new Intent(act, MainActivity.class).setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
        intent.putExtra(INTENT_FLAG_SOURCE, true);
        intent.putExtra(IntentFlag.INTENT_FLAG_TAG, tag);
        intent.putExtra(IntentFlag.INTENT_FLAG_SETTING_JUMP_SOURCE, requestCode);
        act.startActivity(intent);
    }

    /**
     * 跳转到布置作业成功界面
     */
    public static void jumpToWorkSuccessActivity(Activity act, String tag, int requestCode, String workName, long sendDate, long completeDate,
                                                 List<PubLishClassBean> classList, List<PublishWorkContent> contents, int termId) {
        Intent intent = new Intent(act, TeaPublishSuccessActivity.class);
        intent.putExtra(INTENT_FLAG_SOURCE, true);
        intent.putExtra(IntentFlag.INTENT_FLAG_TAG, tag);
        intent.putExtra(IntentFlag.INTENT_FLAG_WORK_ID, termId);
        intent.putExtra(IntentFlag.INTENT_FLAG_WORK_NAME, workName);
        intent.putExtra(IntentFlag.INTENT_FLAG_WORK_TIME, sendDate);
        intent.putExtra(IntentFlag.INTENT_FLAG_WORK_EFFECTIV_TIME, completeDate);
        intent.putExtra(IntentFlag.INTENT_FLAG_STUDENT_LIST, (Serializable) classList);
        intent.putExtra(IntentFlag.INTENT_FLAG_OBJ_LIST, (Serializable) contents);
        act.startActivityForResult(intent, requestCode);
    }

    /**
     * 跳转到发布作业选组选人页面
     *
     * @param act
     * @param classId
     */
    public static void jumpToChooseGroupActivity(Activity act, int classId, int isChecked, String className, List<StudentGroupBean> studentBeanLists, int requestCode) {
        Intent intent = new Intent(act, ChooseGroupActivity.class);
        intent.putExtra(INTENT_FLAG_SOURCE, true);
        intent.putExtra(IntentFlag.INTENT_FLAG_CLASS_ID, classId);
        intent.putExtra(IntentFlag.INTENT_FLAG_CHECKID, isChecked);
        intent.putExtra(IntentFlag.INTENT_FLAG_STUDENT_LIST, (Serializable) studentBeanLists);
        intent.putExtra(IntentFlag.INTENT_FLAG_CLASS_NAME, className);
        act.startActivityForResult(intent, requestCode);
    }

    /**
     * 跳转到添加书籍
     *
     * @param goBackId    返回按钮的文字id
     * @param act         启动activity
     * @param fragment
     * @param requestCode 返回码
     */
    public static void jumpToAddBook(int goBackId, Activity act,
                                     Fragment fragment, int requestCode) {
        Intent intent = getBaseIntent(goBackId, act, AddBookActivity.class);
        act.startActivityForResult(intent, requestCode);
    }

    /**
     * ChooseSchool跳转到书柜
     *
     * @param goBackId
     * @param act
     * @param requestCode
     */
    public static void jumpToAddBook(int goBackId, Activity act, int requestCode) {
        Intent intent = getBaseIntent(goBackId, act, AddBookActivity.class);
        act.startActivityForResult(intent, requestCode);
    }

    /**
     * ChooseSchool跳转到书柜，再跳转到微商城
     *
     * @param goBackId
     * @param act
     * @param requestCode
     */
    public static void jumpToAddBookAndService(int goBackId, Activity act, int requestCode) {
        Intent intent = getBaseIntent(goBackId, act, AddBookActivity.class);
        intent.putExtra("jumpToService", true);
        act.startActivityForResult(intent, requestCode);
    }


    /**
     * 体验服务后返回到书柜列表
     *
     * @param goBackId
     * @param act
     */
    public static void jumpToAddBookAndService(int goBackId, Activity act, Service service) {
        Intent intent = getBaseIntent(goBackId, act, AddBookActivity.class);
        intent.putExtra("service", service);
        intent.putExtra("fromBookShop", true);
        act.startActivity(intent);
    }

    /**
     * 跳转到编辑书籍界面
     *
     * @param goBackId
     * @param act
     * @param fragment
     * @param epaperInfoList
     * @param requestCode
     */
    public static void jumpToEditBook(int goBackId, Activity act,
                                      Fragment fragment, List<EpaperInfo> epaperInfoList, int requestCode) {
        Intent intent = getBaseIntent(goBackId, act, EditBookActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_OBJ_LIST,
                (Serializable) epaperInfoList);
        fragment.startActivityForResult(intent, requestCode);
    }


    /**
     * 跳转设置页面
     *
     * @param goBackId
     * @param act
     */
    public static void jumpSystemToSetting(int goBackId, Activity act) {
//        Intent intent = new Intent(Settings.ACTION_SETTINGS);
//        intent.putExtra(INTENT_FLAG_SOURCE, true);
//        intent.putExtra(GO_BACK_ID, goBackId);
//        act.startActivity(intent);
        XXPermissionTool.startSettingActivity(act);
    }

    /**
     * 跳转到搜索书籍页面
     *
     * @param id      返回图标ID
     * @param context
     */
    public static void jumpToSerachBook(int id, Activity context, int requestCode) {

        Intent intent = getBaseIntent(id, context, SearchBookActivity.class);
        context.startActivityForResult(intent, requestCode);

    }

    /**
     * 跳转到搜索书籍页面
     *
     * @param id      返回图标ID
     * @param context
     */
    public static void jumpToShopSerachBook(int id, Activity context, int requestCode) {

        Intent intent = getBaseIntent(id, context, ShopSearchBookActivity.class);
        context.startActivityForResult(intent, requestCode);

    }

    /**
     * 跳转到搜索书籍页面
     *
     * @param id      返回图标ID
     * @param context
     */
    public static void jumpToAllServiceOrBook(int id, Activity context, int type, int requestCode, Subject subject) {

        Intent intent = getBaseIntent(id, context, AllServiceOrBookActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_TYPE, type);
        if (null != subject) {
            intent.putExtra(IntentFlag.INTENT_FLAG_OBJ, subject);
        }
        context.startActivityForResult(intent, requestCode);
    }

    /**
     * 跳转到banner广告页面
     *
     * @param id      返回图标ID
     * @param context
     */
    public static void jumpToBannerAdActivity(int id, Activity context, BannerBean bannerBean, int requestCode) {

        Intent intent = getBaseIntent(id, context, BannerAdActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_OBJ, bannerBean);
        context.startActivityForResult(intent, requestCode);
    }

    public static void jumpToWrite(int id, Activity context) {

        Intent intent = getBaseIntent(id, context, JournalActivity.class);
        context.startActivity(intent);

    }

    public static void jumpToTestAct(int id, Activity context) {
        Intent intent = getBaseIntent(id, context, TestActicity.class);
        context.startActivity(intent);
    }

    /**
     * 跳转到选择单词页面
     *
     * @param resourceUrl
     */
    public static void jumpToChooseWord(Activity act, String resourceName, String resourceUrl, String versionId, Boolean isChecked,
                                        FollowReadWordDetailBeans followReadWordDetailBeans, int workLong, String requirementContent,
                                        String parentVersionId, int moduleId, final String resourceType, int requestCode) {
        Intent intent = getBaseIntent(R.string.go_back, act, ChooseWordActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_RESOURCE_URL, resourceUrl);
        intent.putExtra(IntentFlag.INTENT_FLAG_RESOURCE_NAME, resourceName);
        intent.putExtra(IntentFlag.INTENT_FLAG_VERSION_ID, versionId);
        intent.putExtra(IntentFlag.INTENT_FLAG_BOOLEAN, isChecked);
        intent.putExtra(IntentFlag.INTENT_FLAG_OBJ, followReadWordDetailBeans);
        intent.putExtra(IntentFlag.INTENT_FLAG_WORK_LONG, workLong);
        intent.putExtra(IntentFlag.INTENT_FLAG_READ_TIME, requirementContent);
        intent.putExtra(IntentFlag.INTENT_FLAG_PARENT_VERSION_ID, parentVersionId);
        intent.putExtra(IntentFlag.INTENT_FLAG_MODULE_ID, moduleId);
        intent.putExtra(IntentFlag.INTENT_FLAG_RESOURCE_TYPE, resourceType);
        intent.putExtra(IntentFlag.INTENT_FLAG_REQUEST_CODE_FROM, requestCode);
        act.startActivityForResult(intent, requestCode);
    }

    /**
     * 跳转到选择段落页面
     */
    public static void jumpToChooseSentence(Activity act, String resourceName, String resourceUrl, String versionId, Boolean isChecked,
                                            FollowreadTextParagraphBean followreadTextParagraphBean, int workLong, String requirementContent,
                                            String parentVersionId, int moduleId, final String resourceType, String workName, int requestCode) {
        Intent intent = new Intent(act, ChooseSentenceActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_RESOURCE_URL, resourceUrl);
        intent.putExtra(IntentFlag.INTENT_FLAG_VERSION_ID, versionId);
        intent.putExtra(IntentFlag.INTENT_FLAG_RESOURCE_NAME, resourceName);
        intent.putExtra(INTENT_FLAG_SOURCE, true);
        intent.putExtra(IntentFlag.INTENT_FLAG_BOOLEAN, isChecked);
        intent.putExtra(IntentFlag.INTENT_FLAG_OBJ, followreadTextParagraphBean);
        intent.putExtra(IntentFlag.INTENT_FLAG_WORK_LONG, workLong);
        intent.putExtra(IntentFlag.INTENT_FLAG_PARENT_VERSION_ID, parentVersionId);
        intent.putExtra(IntentFlag.INTENT_FLAG_READ_TIME, requirementContent);
        intent.putExtra(IntentFlag.INTENT_FLAG_MODULE_ID, moduleId);
        intent.putExtra(IntentFlag.INTENT_FLAG_WORK_NAME, workName);
        intent.putExtra(IntentFlag.INTENT_FLAG_RESOURCE_TYPE, resourceType);
        act.startActivityForResult(intent, requestCode);
    }

    /**
     * 跳转到听说模考选择大题页面
     */
    public static void jumpToListenSpeakChooseWork(Activity act, String resourceName, String resourceUrl, String versionId, Boolean isChecked,
                                                   String tag, ListenSpeakExaminBean listenSpeakExaminBean, int workLong, int requestCode) {
        Intent intent = new Intent(act, ListenSpeakChooseWorkActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_RESOURCE_URL, resourceUrl);
        intent.putExtra(IntentFlag.INTENT_FLAG_VERSION_ID, versionId);
        intent.putExtra(IntentFlag.INTENT_FLAG_RESOURCE_NAME, resourceName);
        intent.putExtra(INTENT_FLAG_SOURCE, true);
        intent.putExtra(IntentFlag.INTENT_FLAG_BOOLEAN, isChecked);
        intent.putExtra(IntentFlag.INTENT_FLAG_TAG, tag);
        intent.putExtra(IntentFlag.INTENT_FLAG_OBJ, listenSpeakExaminBean);
        intent.putExtra(IntentFlag.INTENT_FLAG_WORK_LONG, workLong);
        act.startActivityForResult(intent, requestCode);
    }

    /**
     * 跳转至听说模考选择作业页面
     *
     * @param goBackId
     * @param act
     * @param resourceName          资源名
     * @param resourceUrl           资源url
     * @param versionId
     * @param isChecked             是否选中
     * @param tag
     * @param listenSpeakExaminBean 作业详情
     * @param workLong              作业时长
     * @param requestCode
     */
    public static void jumpToListenSpeakChooseWorkHtml(int goBackId, Activity act, String resourceName, String resourceUrl, String versionId,
                                                       Boolean isChecked, String tag, ListenSpeakExaminBean listenSpeakExaminBean,
                                                       int workLong, String parentVersionId, int moduleId,
                                                       final String resourceType, int requestCode) {
        Intent intent = getBaseIntent(goBackId, act, ListenSpeakChooseWorkHtml.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_RESOURCE_URL, resourceUrl);
        intent.putExtra(IntentFlag.INTENT_FLAG_VERSION_ID, versionId);
        intent.putExtra(IntentFlag.INTENT_FLAG_RESOURCE_NAME, resourceName);
        intent.putExtra(IntentFlag.INTENT_FLAG_BOOLEAN, isChecked);
        intent.putExtra(IntentFlag.INTENT_FLAG_TAG, tag);
        intent.putExtra(IntentFlag.INTENT_FLAG_OBJ, listenSpeakExaminBean);
        intent.putExtra(IntentFlag.INTENT_FLAG_WORK_LONG, workLong);
        intent.putExtra(IntentFlag.INTENT_FLAG_PARENT_VERSION_ID, parentVersionId);
        intent.putExtra(IntentFlag.INTENT_FLAG_MODULE_ID, moduleId);
        intent.putExtra(IntentFlag.INTENT_FLAG_RESOURCE_TYPE, resourceType);
        act.startActivityForResult(intent, requestCode);
    }

    /**
     * 跳转至发布打卡作业页面
     *
     * @param goBackId
     * @param act
     */
    public static void jumpToPublishDKWorkHtml(int goBackId, Activity act) {
        Intent intent = getBaseIntent(goBackId, act, PublishDKWorkHtml.class);
        act.startActivity(intent);
    }

    public static void jumpToAttentionWork(int goBackId, Activity act,List<FollowTeacher> followTeacherList) {
        Intent intent = getBaseIntent(goBackId, act, AttentionWorkActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_OBJ_LIST,
                (Serializable) followTeacherList);
        act.startActivity(intent);
    }

    /**
     * 跳转听说模考小题详情（网页）
     *
     * @param index     索引
     * @param versionId
     * @param title     标题
     * @param act
     */
    public static void jumpToListenSpeakTopic(int goBackId, int index, String versionId, String title, String tag, Activity act) {
        Intent intent = getBaseIntent(goBackId, act, ListenSpeakTopicDetaisActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_LISTEN_SPEAK_INDEX, index);
        intent.putExtra(IntentFlag.INTENT_FLAG_VERSION_ID, versionId);
        intent.putExtra(IntentFlag.INTENT_FLAG_TITLE, title);
        intent.putExtra(IntentFlag.INTENT_FLAG_TAG, tag);
        act.startActivity(intent);
    }

    /**
     * 跳转到互动教程
     *
     * @param goBackId
     * @param versionId
     * @param title
     * @param packageId
     * @param cId
     * @param act
     */
    public static void jumpToInteractiveTutorial(int goBackId, String versionId, String title, String packageId, String cId, Activity act) {
        Intent intent = getBaseIntent(goBackId, act, InteractiveTutorialDetaisActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_VERSION_ID, versionId);
        intent.putExtra(IntentFlag.INTENT_FLAG_TITLE, title);
        intent.putExtra(IntentFlag.INTENT_FLAG_BOOKID, packageId);
        intent.putExtra(IntentFlag.INTENT_FLAG_CID, cId);
        act.startActivity(intent);

    }

    /**
     * 跳转至班级成绩页面
     *
     * @param act
     * @param publishWorkRecords
     * @param backId
     */
    public static void jumpToClassGrades(Activity act, PublishWorkRecords publishWorkRecords, int backId) {
        Intent intent = getBaseIntent(backId, act, ClassGradesActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_OBJ, publishWorkRecords);
        intent.putExtra(INTENT_FLAG_SOURCE, true);
        act.startActivity(intent);
    }

    /**
     * 跳转至学生成绩页面
     *
     * @param act
     * @param publishWorkRecords
     * @param index
     * @param workContents
     * @param backId
     */
    public static void jumpToStudentGrades(Activity act, PublishWorkRecords publishWorkRecords, int index, HomeWorkContents workContents, int backId) {
        Intent intent = getBaseIntent(backId, act, StudentGradesActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_OBJ, publishWorkRecords);
        //intent.putExtra(INTENT_FLAG_SOURCE, true);
        intent.putExtra(IntentFlag.INTENT_FLAG_SENT_INDEX, index);
        intent.putExtra(IntentFlag.INTENT_FLAG_WORK_CONTENT, workContents);
        act.startActivity(intent);
    }

    /**
     * 跳转至课堂作业成绩页面
     *
     * @param activity
     * @param classWorkRecord
     * @param classWorkContent
     * @param backId
     */
    public static void jumpToClassWorkGrades(Activity activity, ClassWorkRecord classWorkRecord, ClassWorkContent classWorkContent, int backId) {
        Intent baseIntent = getBaseIntent(backId, activity, ClassWorkGradesActivity.class);
        baseIntent.putExtra(IntentFlag.INTENT_FLAG_CLASS_WORK_RECORD, classWorkRecord);
        baseIntent.putExtra(IntentFlag.INTENT_FLAG_WORK_CONTENT, classWorkContent);
        activity.startActivity(baseIntent);
    }

    /**
     * 跳转至打卡作业详情
     *
     * @param act
     * @param workId
     * @param className
     * @param backId
     */
    public static void jumpToDKWorkDetails(Activity act, String workId, String className, int backId) {
        Intent baseIntent = getBaseIntent(backId, act, DKWorkDetailsActivity.class);
        baseIntent.putExtra(IntentFlag.INTENT_FLAG_CLASS_NAME, className);
        baseIntent.putExtra(IntentFlag.INTENT_FLAG_WORK_ID, workId);
        act.startActivity(baseIntent);
    }

    public static void jumpToWorkReport(Activity act, int goBackId, String classId, String className, String tag) {
        Intent baseIntent = getBaseIntent(goBackId, act, WorkReportActivity.class);
        baseIntent.putExtra(IntentFlag.INTENT_FLAG_CLASS_ID, classId);
        baseIntent.putExtra(IntentFlag.INTENT_FLAG_CLASS_NAME, className);
        baseIntent.putExtra(IntentFlag.INTENT_FLAG_TAG, tag);
        act.startActivity(baseIntent);
    }

}
